import React, {Component, PropTypes} from 'react';
import {View, Text} from 'react-native';

/**
 * 无数据时的视图
 * Created by 10691 on 17/5/22.
 */
export default class NoDataView extends Component {

    static propTypes = {
        // 是否显示无数据时的视图
        isShowNoDataView: PropTypes.bool,
        text: PropTypes.string
    };

    static defaultProps = {
        // 默认显示无数据时的视图
        isShowNoDataView: true,
        text: '无数据'
    };

    render() {
        return (
            <View style={{
                flex: 1,
                justifyContent: 'center',
                alignItems: 'center',
                display: this.props.isShowNoDataView ? 'flex' : 'none',
            }}>
                <Text style={{fontSize: 25}}>{this.props.text}</Text>
            </View>
        );
    }
}

